package com.uoss.applications.modules.foundation.biz.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.uoss.applications.framework.dao.model.QueryModel;
import org.uoss.applications.framework.dao.model.ResultSetModel;
import org.uoss.applications.framework.exception.BIZException;
import org.uoss.applications.framework.exception.DAOException;
import org.uoss.applications.framework.service.GeneralService;

import com.uoss.applications.modules.foundation.biz.IAgencyBIZ;
import com.uoss.applications.modules.foundation.entities.TcAgency;

@Service
@Transactional
public class AgencyBIZImpl extends GeneralService<TcAgency> implements IAgencyBIZ {
	
	@Override
	public void addAgency(TcAgency agency) throws BIZException {
		try {
			this.getGeneralObjectDAO().addGeneralObject(agency);
		} 
		catch (DAOException e) {
			e.printStackTrace();
		}
	}

	@Override
	public ResultSetModel<TcAgency> getAgencyResultSetByPaging(QueryModel query) throws BIZException {
		ResultSetModel<TcAgency> result = null;
		try {
			result = this.getGeneralObjectDAO().getResultSetByPaging(TcAgency.class, query);
		} 
		catch (DAOException e) {
			e.printStackTrace();
		}
		return result;
	}
}
